import * as types from './mutation-types'
import {getMyfaces,addFace} from "@/api/face.js"
export default {
	async initFace({dispatch,rootState}){
		await dispatch('fetchFaces')
	},
	async fetchFaces({commit}){
		const faces = await getMyfaces({pageNo:1,pageSize:999})||[]
		commit(types.UPDATE_FACES,faces)
		return faces
	},
	async addFace({commit,getters:{faces}},face){
		const res = await addFace(face)
		console.log('res',res)
		commit(types.UPDATE_FACES,[face,...faces])
	},
	async removeFaces({commit,getters:{faces}},faceList){
		
	}
}
